<template>
  <footer class="footer_guide">
    <span class="guide_item" :class="{on: $route.path==='/video'}" @click="goTo('/video')">
      <span class="item_icon">
        <i class="fas fa-video"></i>
      </span>
      <span>视频</span>
    </span>
    <span class="guide_item" :class="{on: $route.path==='/music'}" @click="goTo('/music')">
      <span class="item_icon">
        <i class="fas fa-music"></i>
      </span>
      <span>音乐</span>
    </span>
    <span class="guide_item" :class="{on: $route.path==='/profile'}" @click="goTo('/profile')">
      <span class="item_icon">
        <i class="fas fa-user"></i>
      </span>
      <span>我的</span>
    </span>
  </footer>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    goTo(path) {
      // 编程式路由导航
      this.$router.replace(path);
    }
  }
};
</script>
<style lang='less' scoped>
.footer_guide {
  border-top: 1px solid #ccc;
  position: fixed;
  z-index: 100;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #fff;
  width: 100%;
  height: 50px;
  display: flex;
  .guide_item {
    display: flex;
    flex: 1;
    text-align: center;
    flex-direction: column;
    align-items: center;
    margin: 5px;
    color: #999999;
    &.on {
      color: #02a774;
    }
    span {
      font-size: 12px;
      margin-top: 2px;
      margin-bottom: 2px;
      .iconfont {
        font-size: 22px;
      }
    }
  }
}
</style>